package com.hong.spring.aop.config;

import com.hong.spring.aop.service.Animal;
import com.hong.spring.aop.service.impl.FemaleAnimal;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.DeclareParents;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class AspectConfig {
    /**
     * "+"表示person的所有子类；defaultImpl 表示默认需要添加的新的类
     */
    @DeclareParents(value = "com.hong.spring.aop.service.Person+", defaultImpl = FemaleAnimal.class)
    public Animal animal;
}
